unit DMOldOnlineNote;

interface

uses
  SysUtils, Classes, DB, ADODB;

type
  TDM = class(TDataModule)
    ADOCon: TADOConnection;
    ADOQOnlineNote: TADOQuery;
    DSOnlineNote: TDataSource;
  private
    { Private declarations }
  public
    function OpenDatabase(APath: string): boolean;
    { Public declarations }
  end;

var
  DM: TDM;

implementation

{$R *.dfm}

function TDM.OpenDatabase(APath: string): boolean;
var
  strCon:string;
begin
  strCon:='Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source='
    +APath+';Mode=Share Deny None;Extended Properties="";'
    +'Jet OLEDB:System database="";Jet OLEDB:Registry Path="";'
    +'Jet OLEDB:Database Password="982702";Jet OLEDB:Engine Type=5;'
    +'Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;'
    +'Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";'
    +'Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;'
    +'Jet OLEDB:Don'+''''+'t Copy Locale on Compact=False;'
    +'Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False';
  with ADOCon do
  begin
    if Connected then Connected:=false;
    ConnectionString :=strCon;
    try
      Connected:=true;
      ADOQOnlineNote.Active :=true;
    finally
      Result:=true;
    end;        //end try
  end;  //end with
end;

end.
